package cn.lanqiao.blog.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;

import cn.lanqiao.blog.service.ViewService;
import cn.lanqiao.blog.vo.ViewVO;

@RestController
@RequestMapping("view")
public class ViewController {

	@Autowired
	private ViewService viewService;
	
	//访客数
	@RequestMapping("getViewsCount")
	public int getViewsCount(Integer userId) {
		return viewService.getViewsCount(userId);
	}
	
	//访客列表
	@RequestMapping("getViewsList")
	public PageInfo<ViewVO> getViewsList(Integer userId, Integer pageNum, Integer pageSize){
		return viewService.getViewsList(userId, pageNum, pageSize);
	}
}
